home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / XTRAS / WINUAE / Docs / README.umisef < prev    next >
Text File  |  2000-12-15  |  14KB  |  269 lines

  1. You found it --- this tells you how to use the JIT compiler.
  2.  
  3. First things first: This is not an explanation on how to use UAE under 
  4. linux, or how to use UAE in general. There is other documentation about
  5. that, and if you are not familiar with it, PLEASE read it! This document
  6. only ever mentions stuff specific to the JIT compiler versions!
  7.  
  8. More disclaimers: This stuff is still definitely in a pre-Beta stage.
  9. It works for me, and I am trying to make sure it works for others, too,
  10. but it is impossible to test even a significant portion of the possible
  11. configurations.
  12. Most of my testing is done on 8 bit screens. Other bit depths *should*
  13. work, but have seen little to no testing.
  14. Things might crash at any time, and in interesting ways, and while you
  15. can curse me for it, that's the worst you can do. No liability whatsoever!
  16.  
  17. There are two executables, uae_Xwin and uae_DGA2. Normally, you will want
  18. to use uae_Xwin, it is the much more mature and less experimental one.
  19. Both will connect to the X display in your DISPLAY environment variable,
  20. bring up the GTK Gui (unless you disable it in the config file), and start
  21. the emulation. 
  22.  
  23. If you have a working configuration file for UAE/linux, then you can
  24. use it as-is with these executables. However, be aware that the default
  25. settings for the new configuration options are extremely conservative,
  26. and to get best performance, you should really change them (see below).
  27. [Update: This is no longer true. The default settings are now pretty
  28. much optimal, and you probably won't have any reason to change them!]
  29.  
  30. If you don't have a working configuration file, each executable comes with
  31. a sample config file. Of course, you'll have to change a lot of options,
  32. because your setup and mine are different, but it is a start. I recommend,
  33. however, that you first get and install pristine UAE 0.8.15, and make
  34. sure you *do* have *that* working correctly. UAE-JIT will have no chance
  35. whatsoever of working correctly otherwise.
  36.  
  37.  
  38. There are several new options in the config file. PLease take the time
  39. to read through this, so you know what you are dealing with!
  40.  
  41. comptrustbyte:
  42. comptrustword:
  43. comptrustlong:  Possible values are direct, indirect, indirectKS,
  44.                 and afterPic.
  45.              ***** These options are obsolete now! Leave them at their *****
  46.              ***** default value of "direct" unless you really, really *****
  47.              ***** have a good reason for changing them!               *****
  48.              These describe how aggressive to be when it comes to accessing
  49.              Amiga memory. If you choose "direct", the emulation will be
  50.              very aggressive. If you choose "indirect", the emulation will
  51.              always use the slower but safe method. "indirectKS" will
  52.              use the aggressive method for all code except Kickstart code,
  53.              and "afterPic" uses the safe method until the first time
  54.              a Picasso96 mode is switched on, and the aggressive method
  55.              from then on.
  56.  
  57.              I usually use "afterPic" for all of them; If this fails
  58.              (you get a core dump and UAE exits suddenly --- for me that
  59.              happens when starting SysInfo or GeneticSpecies2), it usually
  60.              is enough to set comptrustbyte to "indirect". Defaults are
  61.              "indirect" for all three. 
  62.  
  63.              Unless you are not using P96 graphics (why not?), there isn't
  64.              much point setting this to "direct". During the startup, weird
  65.              and wonderful things happen in the Amiga, and only having faith
  66.              in the aggressive method once that difficult time is over is
  67.              certainly a wise thing to do.
  68.  
  69. comptrustnaddr: Same as above.
  70.              ***** This option is obsolete now! Leave it at its        *****
  71.              ***** default value of "direct" unless you really, really *****
  72.              ***** have a good reason for changing it!                 *****
  73.              I have yet to find any software that can't handle
  74.              "afterPic", and I'd be very surprised if there is
  75.              any. If you find something that works with "indirect",
  76.              but not with "afterPic", please tell me!
  77.  
  78. compnf:  "yes" or "no". Whether to optimize away flag generation when
  79.              it isn't needed. There really shouldn't be any reason why
  80.              you'd want to set this to "no"; If you find something that
  81.              works with "no" and doesn't with "yes", that's a bug and
  82.              I need to know about it! The reverse is a bug, too, but
  83.              hopefully I squashed that one before the release ;-)
  84.  
  85. cachesize:   The size (in kb) the JIT compiler uses to store pretranslated
  86.              code. When this becomes full, or when the OS issues a
  87.              flush icache instruction, this gets completely emptied, and
  88.              then refilled during execution. Setting it to 0 will
  89.              disable the JIT compiler.
  90.  
  91. comp_flushmode: *NEW* "hard" or "soft". If this is set to soft (the default), 
  92.              an OS induced icache flush doesn't actually empty the 
  93.              cache, but instead checksumming will be used to check whether
  94.              blocks have to be discarded. You'll probably want to leave this
  95.              at its default (otherwise lots of stuff, like the OS, gets
  96.              translated over and over).
  97.  
  98. comp_constjump: *NEW* If this is "yes" (the default), unconditional branches
  99.              will not end a block; Effectively, UAE-JIT compiles "through"
  100.              them. Generally, that's a good idea, as it improves performance.
  101.              However, it makes soft cache flushing impossible for some blocks,
  102.              so if you experience lots and lots of soft cache flushes (e.g.
  103.              when using a Mac emulator), you might try "no" and see whether it
  104.              does any better.
  105.  
  106. compfpu:     If this is "yes" (the default), the JIT compiler will
  107.              be used for the most commonly used FPU instructions. Setting
  108.              it to "no" will disable JIT-compiling for the FPU.
  109.  
  110.  
  111. [Note: The "unroll" option is no longer supported. You should remove it
  112.        from your config files if it's still in there]
  113.  
  114. [Note2: Setting some of those options to sub-optimal values will cause
  115.        UAE-JIT to exit with a message pointing at README.JIT-tuning]
  116. ================= All of the above can be set from the GTK GUI, too ===========
  117. ================= The options below are one-time, config-file only ============
  118.  
  119. avoid_cmov: "yes" or "no". If you have a processor that doesn't support
  120.              the P6-class CMOV instructions, you have to set this to "yes".
  121.              The JIT compiler will then not try to translate any
  122.              instructions for which it would generate code with CMOV
  123.              in it. Better slower than "illegal instruction", right ;-)
  124.  
  125. avoid_dga:   If you use the Xwin executable, setting this to "yes" will
  126.              stop it from even looking for the DGA extension. Obviously,
  127.              it won't use it, either.
  128.  
  129. avoid_vid:   If you use the Xwin executable, setting this to "yes" will
  130.              stop it from even looking for the Vidmode extension. Obviously,
  131.              it won't use it, either.
  132.  
  133. [Note: the following options are not available in the "sanitized" versions
  134.        of UAE-JIT. The executables made available on byron@csse.monash.edu.au
  135.        are not sanitized, but if you compile your own from the patches,
  136.        you need to include the "extra options" patch to get these. And don't
  137.        take my use of the plural in this paragraph to mean anything --- it
  138.        is generic ;-) ]
  139.  
  140. override_dga_address: If you use the DGA2 executable, this will allow you
  141.              to override the linear frame buffer address DGA2 detects.
  142.              Try it first without this, but if you just get a blank grey
  143.              screen (and F12-S gets you a window with the right content),
  144.              your XServer might get it wrong (seems fairly common, in fact).
  145.              Find out the linear frame buffer address (preferably by looking
  146.              at /proc/nnnnn/maps, with nnnnn the pid of the X server --- look
  147.              for a mapping of /dev/mem with the right size; The offset of that
  148.              mapping is the value you are looking for).
  149.              In this option, you provide the *upper 16 bits* of that address.
  150.              So if your linear frame buffer is at 0xd5000000, you set
  151.              override_dga_address to 0xd500. Yes, the config file will take
  152.              hex numbers.
  153.  
  154. ============================ End of Options =============================
  155.  
  156. Many of these options can be changed through the GTK UI. However, as many
  157. of them influence code *generation*, changes will only take effect when
  158. code is newly translated; The already translated code in the cache is
  159. uneffected.
  160. In order to make your changes take effect, you need to force a hard cache
  161. flush. The easiest way to do so is to change the cache size by some small
  162. amount. Remember this step if you try to benchmark the result of various
  163. option settings on performance, otherwise results will be rather 
  164. inconclusive ;-)
  165.  
  166.  
  167. How to get the maximum performance:
  168. -----------------------------------
  169.  
  170. Here are a few tips on how to get the best possible performance, and to
  171. avoid common pitfalls.
  172.  
  173. * Use a 2.3.*, or even better a 2.4test* kernel. Without it, you might 
  174.   not be able to do aggressive memory modes (see README.JIT-tuning)
  175. * The really aggressive memory modes use sysv_shm. By default, the
  176.   largest sysv_shm block you can allocate at one time is 32M, so
  177.   if you have a larger Z3Mem, allocation will fail and the aggressive
  178.   modes get disabled.
  179.   You can change the max size through /proc/sys/kernel/shmmax, the first
  180.   parameter is the max size.
  181. * Use Picasso96 modes!
  182. * Use DGA for your actual display! (If you don't, you CANNOT make any
  183.   comments about sluggish gfx performance. Understood?)
  184. * Alternatively, use CGX3 with direct access to an S3 Virge PCI card
  185.   (see README.pci)
  186. * Set as many of the comptrust* options as possible as aggressively as
  187.   you can without creating a crash [*** obsolete ***]
  188. * For the adventurous: If you use the DGA2 executable with an XFree86 4.0x
  189.   server, AND select a Picasso video mode that has the same width as your
  190.   X virtual screen[1], AND haven't done anything else to prevent you from
  191.   using aggressive memory access (like setting comptrust* to indirect),
  192.   you *should* end up with vastly faster gfxmem access. This is still
  193.   buggy, occasional display corruption when using blits occurs. But 
  194.   for seeing how fast Doom can go on an "Amiga", this is the ticket ;-)
  195. * If your app comes in versions for different CPUs, try all of them.
  196.   I have had good experiences with using 040 versions, particularly
  197.   of RC5 (use "-c 2" to select the 040 core). Of course, this only
  198.   works if the 040 apps don't use 040-specific features, or if you
  199.   have enabled 040 support for UAE
  200.  
  201. Feedback:
  202. =========
  203.  
  204. I need to know about remarkable experiences you have, but I really
  205. don't need to know about unremarkable things. Here is a little guide
  206. as to what is what:
  207.  
  208. Remarkable:
  209.  
  210.   * Something that works with the compiler disabled, but fails with
  211.     it enabled
  212.   * Any occurrence of "illegal instruction" (from Linux) on a P6 class
  213.     machine, or a P5 class machine with avoid_cmov=yes
  214.   * Any failure to boot with a config file that does boot "normal" 
  215.     UAE/linux
  216.   * Anything else that you can clearly identify as an emulation bug,
  217.     rather than as a configuration, hardware or user problem
  218.   * Any patches you can come up with
  219.   * Any offers of sponsorship for further work on it ;-)
  220.  
  221. Unremarkable:
  222.  
  223.   * Any failures attributable to memory shortage
  224.   * Any problems you might have with linux, UAE or the Amiga in general,
  225.     not specific to the JIT compiler version
  226.   * Any statements to the effect that I am a traitor, a lamer, a wannabe,
  227.     a loser, a demigod, a guru, a procrastinator, or anything else along
  228.     those lines
  229.   * Any non-constructive criticism of my coding style. Remember: The only
  230.     valid form of criticism is a patch! (Of course, certain people
  231.     are excepted from this, notably everyone who would be involved
  232.     with integrating this code into other UAE versions ;-)
  233.  
  234. If you think you found something remarkable, PLEASE let me know. And
  235. please describe the circumstances as precisely as possible --- only if
  236. I can recreate the fault can I have a real shot at figuring out what
  237. went wrong.
  238.  
  239.  
  240. Good luck, and looking forward to your feedback,
  241.  
  242.      Bernie  (bmeyer@csse.monash.edu.au)
  243.  
  244.  
  245. P.S.: There is some output to stdout/stderr while running (and some
  246.       directly to the tty). The lines that pop up every second have
  247.       a number of fields. Here are short explanations of each:
  248.  
  249.         * compiled: The total number of bytes the compiled code (and
  250.                     the related bookkepping information) takes up
  251.         * soft: Number of soft cache flushes done in the last second
  252.         * hard: Number of hard cache flushes done in the last second
  253.         * trans: Number of 68k blocks translated in the last second
  254.         * check: Number of 68k blocks that had their checksums check in
  255.                     the last second as a result of a soft cache flush
  256.         * lost: Time "lost" during the last second of emulation time.
  257.                 This should be 0, but if the emulation can't keep up for
  258.                 some reason (like file I/O happening), it can be larger.
  259.                 The output is in seconds; Keep an eye on this if you
  260.                 do self-timed benchmarks!
  261.         * debug/2/3/4: Internal counters I use for debugging. If you have
  262.                 software that can make debug3 and/or debug4 reach more
  263.                 than 100,000, please tell me about it --- these are counting
  264.                 non-compiled FPU instructions executed.
  265.  
  266. [1] In reality, things are even more complex --- what you need to match
  267.     is the pitch of the mode. Normally, that matches the virtualwidth,
  268.     but my Trident 3DImage975 uses a pitch of 1024 for a 640 wide mode....
  269.